package com.snailhd.cloud.redis.service;

import redis.clients.jedis.GeoRadiusResponse;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @ClassName RedisService
 * @Description
 * @Author hd
 * @Date 2019-06-09 11:21
 */
public interface RedisService {

    Set<String> keys(String pattern);

    String get(String key);

    String set(String key, String val);

    String setex(String key, int seconds, String value);

    Long expire(String key, int seconds);

    List<String> mget(String... keys);

    String hget(String key, String field);

    Long hset(String key, String field, String value);

    String hmset(String key, Map<String, String> map);

    List<String> hmget(String key, String... fields);

    Long del(String... keys);

    Long hdel(String key, String... fields);

    Long lpush(String key, String... values);

    List<String> lrange(final String key, final Long start, final Long end);

    List<String> scan(int cursor, String pattern, Integer count);

    String mset(Map<String, String> map);

    Map<String,String> hgetAll(String key);

    String mset(String... keysvalues);

    Long msetnx(Map<String, String> map);

    Long msetnx(String... keysvalues);

    Long zrem(String key, String member);

    Long incr(String key);

    Long lrem(String key, int count, String value);

    Long hincrBy(String key, String field, Long value);

    Long geoadd(String key, double longitude, double latitude, String member);

    List<GeoRadiusResponse> georadius(String key, double longitude, double latitude, double radius, int num);

    Boolean distributedLock(String lockKey, String requestId, long expireTime);

    Boolean releaseDistributedLock(String lockKey, String requestId);

}
